function NavOverlay({ s, t, onClose, onNavigate }) {
  const { Logo, SocialIconRow, Icon } = window.SevcikMarketingDesignSystem_3203fa;
  const [hovered, setHovered] = React.useState(null);
  const today = new Date().toLocaleDateString(s.locale, { day: 'numeric', month: 'long', year: 'numeric' });
  /* Articles first, then case studies that are actually written up; four at
     most, and the block hides itself when there is nothing to show. */
  const stream = [
    ...(s.posts || []).map((p) => ({ key: 'p' + p.id, meta: [p.date, p.read].filter(Boolean).join(' \u00b7 '), title: p.title, kicker: p.category, href: routeHref({ lang: s.htmlLang, screen: 'blog', slug: p.slug }) })),
    ...(s.cases || []).filter((c) => !c.soon).map((c) => ({ key: 'c' + c.id, meta: [t.caseStudyLabel || 'Case study', c.year].filter(Boolean).join(' \u00b7 '), title: c.title, kicker: c.category, href: routeHref({ lang: s.htmlLang, screen: 'cases', slug: c.slug }) })),
  ].slice(0, 4);
  return (
    <div style={{ position: 'fixed', inset: 0, zIndex: 100, background: 'var(--white)', overflowY: 'auto', padding: '20px 5%', boxSizing: 'border-box' }}>
      <div className="sm-nav-grid" style={{ display: 'grid', gridTemplateColumns: '1fr 1.2fr 1fr auto', gap: 32, alignItems: 'start' }}>
        <div>
          <Logo size={120} />
          <p style={{ marginTop: 90, fontFamily: 'var(--font-meta)', fontWeight: 500, fontSize: 12.5, lineHeight: 1.2, color: 'var(--black)' }}>{today}<br />Brno</p>
        </div>
        <nav style={{ display: 'flex', flexDirection: 'column' }}>
          {t.nav.map((it) => (
            <a
              key={it.screen} href={routeHref({ lang: s.htmlLang, screen: it.screen })}
              onClick={(e) => { e.preventDefault(); onNavigate(it.screen); onClose(); }}
              onMouseEnter={() => setHovered(it.screen)} onMouseLeave={() => setHovered(null)}
              style={{
                fontFamily: 'var(--font-display)', fontWeight: 500, fontSize: 'clamp(40px, 5vw, 64px)',
                lineHeight: 1.064, letterSpacing: '-0.015em', textDecoration: 'none',
                color: hovered === it.screen ? 'var(--black)' : 'var(--gray-300)',
                transition: 'color .2s ease',
              }}
            >{it.label}</a>
          ))}
        </nav>
        {/* Contact, socials and the close button read as one right-hand column. */}
        <div className="sm-nav-tail" style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 20, textAlign: 'right' }}>
          <button onClick={onClose} aria-label={t.closeMenu} style={{ background: 'var(--paper)', border: 'none', borderRadius: 'var(--radius-card)', width: 56, height: 56, display: 'flex', alignItems: 'center', justifyContent: 'center', cursor: 'pointer' }}>
            <Icon name="close" size={20} color="var(--black)" />
          </button>
          {/* Two separate tap targets, not a run-on block: each gets its own
              line, room to breathe, and a hairline that only shows on touch. */}
          <div style={{ display: 'flex', flexDirection: 'column', alignItems: 'flex-end', gap: 14, fontFamily: 'var(--font-display)', fontWeight: 500, fontSize: 20, lineHeight: 1.4, color: 'var(--black)' }}>
            <a href={`mailto:${CONTACT.email}`} style={{ color: 'inherit', textDecoration: 'none', minHeight: 44, display: 'inline-flex', alignItems: 'center', borderBottom: '1.5px solid var(--gray-200)' }}>{CONTACT.email}</a>
            <a href={`tel:${CONTACT.whatsapp}`} style={{ color: 'inherit', textDecoration: 'none', minHeight: 44, display: 'inline-flex', alignItems: 'center', borderBottom: '1.5px solid var(--gray-200)' }}>{CONTACT.phone}</a>
          </div>
          <SocialIconRow size={14} gap={16} note={s.socialNote} links={{ linkedin: CONTACT.linkedin }} dark />
        </div>
      </div>
      {/* Latest first: articles and case studies in one stream, so the menu
          shows what's actually new instead of two decorative plates. */}
      {stream.length > 0 && <div className="sm-nav-art" style={{ marginTop: 40, borderTop: '1.5px solid var(--gray-200)', paddingTop: 6 }}>
        {stream.map((it, i) => (
          <a key={it.key} href={it.href} onClick={onClose}
            style={{ display: 'block', textDecoration: 'none', color: 'inherit', padding: '14px 0', borderBottom: i === stream.length - 1 ? 'none' : '1.5px solid var(--gray-200)' }}>
            <div style={{ fontFamily: 'var(--font-mono)', fontWeight: 500, fontSize: 9.5, lineHeight: 1.2, letterSpacing: 'var(--tracking-label)', textTransform: 'uppercase', color: 'var(--gray-500)' }}>{it.meta}</div>
            <h3 style={{ margin: '6px 0 4px', fontFamily: 'var(--font-display)', fontWeight: 500, fontSize: 16, lineHeight: 1.25, letterSpacing: '-0.01em', color: 'var(--black)' }}>{it.title}</h3>
            <div style={{ fontFamily: 'var(--font-meta)', fontWeight: 500, fontSize: 12, lineHeight: 1.2, color: 'var(--gray-600)' }}>{it.kicker}</div>
          </a>
        ))}
      </div>}
    </div>
  );
}

Object.assign(window, { NavOverlay });
